﻿<UserControl x:Class="VAdvantage.Widgets.Counter"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:sys="clr-namespace:System.Collections;assembly=mscorlib"
    xmlns:s="clr-namespace:System;assembly=mscorlib"
    Width="90"  Height="90">
    <UserControl.Resources>
        <Style x:Key="Grid" TargetType="ContentControl">
            <Setter Property="Opacity" Value="1"/>
            <Setter Property="FontFamily" Value="Arial Narrow"/>
            <Setter Property="FontSize"  Value="64"/>
            <!--<Setter Property="FontWeight" Value="Bold"/>-->
            <Setter Property="Template" >
                <Setter.Value>
                    <ControlTemplate>
                        <Border Width="90" Height="90">
                            <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Canvas Width="90" Height="90" >
        <Canvas.Background>
            <ImageBrush ImageSource="/VAdvantage;component/Images/date_panel_bg.png" AlignmentX="Left" AlignmentY="Top" Stretch="Fill" />
        </Canvas.Background>
        <Canvas.Clip>
            <RectangleGeometry Rect="0,0,90,90"/>
        </Canvas.Clip>
        <ItemsControl x:Name="MyCounter">
            <ItemsControl.RenderTransform>
                <TranslateTransform/>
            </ItemsControl.RenderTransform>
            <ContentControl x:Name="NewValue"  Content="0"  Style="{StaticResource Grid}" >
                <ContentControl.Foreground>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#9A9A9A" Offset="0"/>
                        <GradientStop Color="#111111" Offset="0.4"/>
                        <GradientStop Color="#9A9A9A" Offset="0.43"/>
                        <GradientStop Color="WhiteSmoke" Offset="0.47"/>
                        <GradientStop Color="#111111" Offset="0.7"/>
                        <!--<GradientStop Color="#111111" Offset="0.6"/>-->
                        <GradientStop Color="#111111" Offset="0.8"/>
                    </LinearGradientBrush>
                </ContentControl.Foreground>

            </ContentControl>
            <ContentControl x:Name="OldValue"  Content="0"  Style="{StaticResource Grid}" />
        </ItemsControl>
    </Canvas>
</UserControl>
